<?php

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Http\Resources\UserResource;
use App\Http\Requests\Api\UserRequest;

class UserController extends Controller
{
    //用户信息
    public function me(Request $request){
        return $this->resource(new UserResource($request->user()));
    }

    public function store(UserRequest $request){
        $user = $request->user();
        $user->fill($request->all());
        $user->save();
        return $this->resource(new UserResource($user));
    }

}
